import 'package:flutter/material.dart';
import 'button_demo.dart';
import 'floating_action_button_demo.dart';
import 'popup_menu_button_demo.dart';
import './simple_dialog_demo.dart';
import './alert_dialog_demo.dart';
import './bottom_sheet_demo.dart';
import './expansion_pannel_demo.dart';
import './snackbar_demo.dart';
import './chip_demo.dart';
import './datatable_demo.dart';
import './paginate_datatable_demo.dart';
import './card_demo.dart';
import './stepper_demo.dart';
import '../form/form.dart';
import '../form/checkbox_demo.dart';
import '../form/radio_demo.dart';
import '../form/switch_demo.dart';
import '../form/slider_demo.dart';
import '../form/datetime_demo.dart';

class MaterialComponents extends StatelessWidget {
  const MaterialComponents({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Material Components"),
        elevation: 0.0,
      ),
      body: ListView(
        children: [
          ListItem(
            title: "FloatingActionButton",
            page: FloatingActionButtonDemo(),
          ),
          ListItem(
            title: "ButtonDemo",
            page: ButtonDemo(),
          ),
          ListItem(
            title: "PopupMenuButtonDemo",
            page: PopupMenuButtonDemo(),
          ),
          ListItem(
            title: "FormDemo",
            page: FormDemo(),
          ),
          ListItem(
            title: "CheckboxDemo",
            page: CheckboxDemo(),
          ),
          ListItem(
            title: "RadioDemo",
            page: RadioDemo(),
          ),
          ListItem(
            title: "SwitchDemo",
            page: SwitchDemo(),
          ),
          ListItem(
            title: "SliderDemo",
            page: SliderDemo(),
          ),
          ListItem(
            title: "DatetimeDemo",
            page: DatetimeDemo(),
          ),
          ListItem(
            title: "SimpleDialogDemo",
            page: SimpleDialogDemo(),
          ),
          ListItem(
            title: "AlertDialogDemo",
            page: AlertDialogDemo(),
          ),
          ListItem(
            title: "BottonSheetDemo",
            page: BottomSheetDemo(),
          ),
          ListItem(
            title: "SnackBarDemo",
            page: SnackBarDemo(),
          ),
          ListItem(
            title: "ExpansionPanelDemo",
            page: ExpansionPanelDemo(),
          ),
          ListItem(
            title: "ChipDemo",
            page: ChipDemo(),
          ),
          ListItem(
            title: "DataTableDemo",
            page: DataTableDemo(),
          ),
          ListItem(
            title: "PaginationDataTableDemo",
            page: PaginationDataTableDemo(),
          ),
          ListItem(
            title: "CardDemo",
            page: CardDemo(),
          ),
          ListItem(
            title: "StepperDemo",
            page: StepperDemo(),
          ),
        ],
      ),
    );
  }
}

class _WidgetDemo extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("_WidgetDemo"),
        elevation: 0.0,
      ),
      body: Container(
        padding: EdgeInsets.all(16.0),
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Row(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                
              ],
            )
          ],
        ),
      ),
    );
  }
}

class ListItem extends StatelessWidget {

  final String title;
  final Widget page;

  ListItem({
    this.title,
    this.page,
  });

  @override
  Widget build(BuildContext context) {
    return ListTile(
      title: Text(title),
      onTap: () {
        Navigator.of(context).push(
          MaterialPageRoute(builder: (context) => page),
        );
      },
    );
  }
}